<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%--STRUTS LAYOUT--%>
<%@ taglib uri="/WEB-INF/tld/struts-layout.tld" prefix="layout"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic"%>

<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%--   --%>



<script language="javascript" type="text/javascript"
	src="/CSWeb/modules/denuncias/procesos/js/datetimepicker.js"></script>
<script language="javaScript">
	var flagVisa = 0;
	function trim(cadena) {
		var indice = 0;
		var cadAux = "";
		if (cadena != null)
			while (indice < cadena.length) {
				var c = cadena.charAt(indice);
				if (c != ' ') {
					cadAux += c;
				}
				indice++;
			}
		return cadAux;
	}

	function mostrarCamposDenuncia(condicion) {

		alert("entro al java script")
		obj = document.getElementById("camposRobo");
		obj = obj.style;
		obj.display = 'none';

		obj = document.getElementById("camposAcTrans");
		obj = obj.style;
		obj.display = 'none';

		obj = document.getElementById("camposPerDoc");
		obj = obj.style;
		obj.display = 'none';

		if (condicion == '1') {
			obj = document.getElementById("camposRobo");
			obj = obj.style;
			obj.display = 'block';
		}

		if (condicion == '2') {
			obj = document.getElementById("camposAcTrans");
			obj = obj.style;
			obj.display = 'block';
		}

		if (condicion == '3') {
			obj = document.getElementById("camposPerDoc");
			obj = obj.style;
			obj.display = 'block';
		}
	}
</script>

<script
	src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAPDUET0Qt7p2VcSk6JNU1sBTfNr5UEQLT8GRTB7pSzkC2Mqfn4hRK-i12rXVdHRCdEZNxKJmdvtm4Rg"
	type="text/javascript"></script>
<script
	src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=ABQIAAAAPDUET0Qt7p2VcSk6JNU1sBTfNr5UEQLT8GRTB7pSzkC2Mqfn4hRK-i12rXVdHRCdEZNxKJmdvtm4Rg"
	type="text/javascript"></script>

<script
	src="http://www.google.com/uds/solutions/mapsearch/gsmapsearch.js"
	type="text/javascript"></script>

<layout:html locale="true" styleClass="FORM">


<layout:form action="/registrarDenuncia.do" styleClass="FORM"
	width="300">
	<layout:panel styleClass="FORM" key="DetalleDenuncia">
		<layout:row>
			<layout:column width="100%">
				<layout:text key="denuncia.codigo" property="CDenuncia"
					styleClass="LABEL" readonly="true" />
				<layout:text key="denuncia.codigoPersonal" property="CPersonal"
					styleClass="LABEL" readonly="true" />
				<layout:date key="denuncia.fecha" property="FDenuncia"
					styleClass="LABEL" disabled="true" />
				<layout:date key="denuncia.hora" property="HDenuncia"
					styleClass="LABEL" disabled="true" />
				<layout:text key="denuncia.tipoDelito"
					property="denTipoDelito.XTipoDelito" readonly="true"
					styleClass="LABEL" />
				<%--			<layout:text key="denuncia.subtipoDelito"  property="denTipoDelito.denSubTipoDelito.XDescripcion" readonly="true" styleClass="LABEL"/>--%>
				<c:if test='${CTipoDelito == 3}'>
					<layout:text key="denuncia.tipoDocumento"
						property="denTipoDocumento.XDescripcion" readonly="true"
						styleClass="LABEL" />
				</c:if>
				<c:if test='${CTipoDelito == 2}'>
					<layout:text key="denuncia.pasajeros" mode="H,H"
						property="NPersonas" readonly="true" styleClass="LABEL" />
					<layout:text key="denuncia.heridos" property="NHeridos"
						readonly="true" styleClass="LABEL" />
					<layout:text key="denuncia.victimas" property="NVictimas"
						readonly="true" styleClass="LABEL" />
				</c:if>
				<layout:text key="denuncia.estado"
					property="denEstadoDenuncia.XEstado" readonly="true"
					styleClass="LABEL" />
			</layout:column>
			<layout:column>
				<body onunload="GUnload()">
				<layout:panel styleClass="FORM" key="UbicacionDelito">
					<div id="mapsearch" style="width: 450px; height: 300px"></div>
				</layout:panel>
				<script src="/CSWebJ/modules/comun/js/submits.js"
					type="text/javascript"></script>
				<script src="/CSWebJ/modules/comun/js/googleMapFunctions.js"
					type="text/javascript"></script>

				<script type='text/javascript'
					src='/CSWebJ/dwr/interface/BeanUbicarDelitos.js'></script>
				<script type='text/javascript' src='/CSWeb/dwr/engine.js'></script>

				<script type="text/javascript">
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById("mapsearch"));
		var form = document.RegistrarDenunciaForm;
		function f_mostrarDelitoResult(point) {
			var markerOptions;
			var tinyIcon = new GIcon();
<%--									tinyIcon.iconSize = new GSize(10, 10);--%>
	tinyIcon.iconSize = new GSize(20, 20);
			tinyIcon.iconAnchor = new GPoint(0, 0);
<%--									tinyIcon.image ="/CSWeb/images/colors/ff3399.png";--%>
	tinyIcon.image = "/CSWeb/images/aspa.gif";
			markerOptions = {
				icon :tinyIcon
			};
<%--									alert("El punto "+point+" tiene icono "+tinyIcon.image);						--%>
	var gLatLng = eval(point);
			var marker = new GMarker(gLatLng, markerOptions);
			map.setCenter(gLatLng, 17);
			map.addOverlay(marker);
		}
<%--								alert("La denuncia tiene codigo "+form.CDenuncia);--%>
	BeanUbicarDelitos.mostrarDelito(form.CDenuncia.value,
				f_mostrarDelitoResult);
	}
</script>
				<html:hidden property="cadenaPuntos" />
				</body>
			</layout:column>
		</layout:row>
		<layout:textarea key="denuncia.hecho" maxlength="1000" cols="70"
			rows="15" property="XDetallehecho" readonly="true"
			styleClass="TEXTAREA" />
		<layout:textarea key="denuncia.observacion" cols="70" rows="3"
			property="XObservacion" readonly="true" styleClass="TEXTAREA" />
		<layout:formActions>
			<layout:image property="btnAprobar" altKey="image.aprobar.alttext"
				srcKey="image.aprobar" bundle="bundle.image" />
			<layout:image property="btnDesaprobar"
				altKey="image.desaprobar.alttext" srcKey="image.desaprobar"
				bundle="bundle.image" />
		</layout:formActions>

	</layout:panel>
</layout:form>
</layout:html>
